<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>play (MusicBank)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File music_bank.rb, line 220</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">play</span>(<span class="ruby-identifier">song</span>=<span class="ruby-keyword kw">nil</span>)
    <span class="ruby-identifier">playlist</span>(<span class="ruby-identifier">:m3u</span>, <span class="ruby-identifier">:save</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@location</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/musicbank.m3u&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">song</span>;
    <span class="ruby-identifier">command</span> = <span class="ruby-ivar">@location</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">+</span> ((<span class="ruby-identifier">song</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">get_song</span>(<span class="ruby-identifier">song</span>) <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;musicbank.m3u&quot;</span>);
    <span class="ruby-identifier">command</span> = <span class="ruby-ivar">@run_play</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;(%p)&quot;</span>, <span class="ruby-identifier">command</span>);
    <span class="ruby-comment cmt">#Let the player for another thread instead of waiting it to exit</span>
    <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>{<span class="ruby-identifier">system</span>(<span class="ruby-identifier">command</span>);}
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>